#!/usr/bin/perl

$score = 0;
while($line=<STDIN>) {
	chomp($line);
	@p = split(/\s+/,$line);
	$score+=$p[$#p];
	
}
print $score;
